Page({
  data: {

  },
  onLoad: function (options) {

  },
  /**
   * 登录接口
   */
  getUserProfile() {
    console.log("\u5934\u6761\u767B\u5F55");
    tt.getUserProfile({
      success(res) {
        console.log(res)
        tt.login({
          success(res2) {
            console.log(res2)
            tt.request({
              url: "http://127.0.0.1:8081/purchase/preUser/loginEncry",
              data: {
                "encryptedData":res.encryptedData,
                "iv":res.iv,
                "code":res2.code
              },
              method: "POST",
              header: {
                "Content-Type": "application/json"
              },
              success: (res3) => {
                console.log(res3.data);
              }
            });
          },
          fail(res2) {
            console.log(`login \u8C03\u7528\u5931\u8D25`);
          }
        });
      },
      fail(res) {
        console.log("getUserProfile \u8C03\u7528\u5931\u8D25", res);
      }
    });
  }
  
})

 